Skip to content

TEST: Add test for Triangle.to_pickle().#1033

Merged
genedan merged 1 commit into
mainfrom
io_tests
Jun 21, 2026
Merged

TEST: Add test for Triangle.to_pickle().#1033
genedan merged 1 commit into
mainfrom
io_tests

Conversation

@genedan

@genedan genedan commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Summary of Changes

Adds a test for the 2 remaining lines in io.py. Dumps a pickle, reads it back in, and compares.

Related GitHub Issue(s)

Additional Context for Reviewers

  • I passed tests locally for both code (uv run pytest) and documentation changes (uv run jb build docs --builder=custom --custom-builder=doctest)

Note

Low Risk
Test-only coverage plus minor non-functional io.py housekeeping; no production logic changes.

Overview
Adds test_triangle_to_pickle, which writes pickles via Triangle.to_pickle (not raw dill.dump) for single-index raa and multi-index clrd, then asserts cl.read_pickle returns an equal triangle and that the file exists—closing coverage gaps on TriangleIO.to_pickle in io.py.

chainladder/core/io.py gets a short module docstring and import cleanup: joblib is removed, and dill / json / pandas are grouped at the top (behavior of pickle I/O unchanged).

Reviewed by Cursor Bugbot for commit 433f940. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov

codecov Bot commented Jun 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.21%. Comparing base (b6e8349) to head (433f940).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1033      +/-   ##
==========================================
+ Coverage   89.17%   89.21%   +0.03%     
==========================================
  Files          89       89              
  Lines        5165     5164       -1     
  Branches      661      661              
==========================================
+ Hits         4606     4607       +1     
+ Misses        392      390       -2     
  Partials      167      167              
Flag Coverage Δ
unittests 89.21% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@genedan genedan merged commit 468f11a into main Jun 21, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants